package com.atguigu.visitor;

/**
 * @program: design-patterns
 * @author: yangshen
 * @description:
 * @create: 2022-03-04 23:24
 **/
public class Client {
    public static void main(String[] args) {
        //创建ObjectStructure
        ObjectStructure objectStructure = new ObjectStructure();
        objectStructure.add(new Man("张三"));
        objectStructure.add(new Man("李四"));
        objectStructure.add(new WoMan("王丽"));

        //成功
        Success success = new Success();
        objectStructure.display(success);

        System.out.println("--------------------访问者行为：失败------------------------------");

        //失败
        Fail fail = new Fail();
        objectStructure.display(fail);

        System.out.println("--------------------访问者行为：暂不评价------------------------------");

        //暂不评价
        Wait wait = new Wait();
        objectStructure.display(wait);
    }
}
